import {createRouter, createWebHistory} from "vue-router";

const routes = [
    {
        path: '/testDev',
        component: () => import('../pages/student/UserCenterPage.vue')
    },
    {
        path: '/',
        redirect: '/signin'
    },
    {
        path: '/signin',
        component: () => import('../pages/SignInPage.vue')
    },
    {
        path: '/studentmain',
        component: () => import('../pages/StudentMainPage.vue'),
        children: [
            {
                path: '',
                redirect: '/studentmain/classtask'
            },
            {
                path: 'classtask',
                component:()=>import('../pages/student/ClassTaskPage.vue')
            },
            {
                path: 'onlinetask',
                component:()=>import('../pages/student/OnlineTaskPage.vue')
            },
            {
                path: 'classcorrect',
                component:()=>import('../pages/student/ClassCorrectPage.vue')
            },
            {
                path: 'onlinecorrect',
                component:()=>import('../pages/student/OnlineCorrectPage.vue')
            },
            {
                path: 'studentanalysis',
                component:()=>import('../pages/student/StudentAnalysisPage.vue')
            },
            {
                path: 'listeningexercise',
                component:()=>import('../pages/student/ListeningExercisePage.vue')
            },
            {
                path: 'oralpractice',
                component:()=>import('../pages/student/OralPracticePage.vue')
            },
            {
                path: 'usercenter',
                component:()=>import('../pages/student/UserCenterPage.vue')
            }
        ]
    },
    {
        path: '/teachermain',
        component:()=>import('../pages/TeacherMainPage.vue'),
        children: [
            {
                path: '',
                redirect: '/teachermain/newtask'
            },
            {
                path: 'newtask',
                component:()=>import('../pages/teacher/NewTaskPage.vue')
            },
            {
                path: 'taskcorrect',
                component: () => import('../pages/teacher/TaskCorrectPage.vue')
            },
            {
                path: 'classanalysis',
                component: () => import('../pages/teacher/ClassAnalysisPage.vue')
            },
            {
                path: 'studentanalysis',
                component: () => import('../pages/teacher/StudentAnalysisPage.vue')
            },
            {
                path: 'classmanage',
                component: () => import('../pages/teacher/ClassManagePage.vue')
            },
            {
                path: 'usercenter',
                component: () => import('../pages/teacher/UserCenterPage.vue')
            }
        ]
    },
    //第三层路由
    {
        path:'/teacher/editTask',
        component:()=>import('../pages/teacher/newtask/EditTaskPage.vue')
    },
]

const router = createRouter({
    history: createWebHistory(),
    routes
})

export default router;